﻿using System.Data.Entity.ModelConfiguration;
using ModelLayer;

namespace DataLayer.Configurations
{
    public class UserConfig : EntityTypeConfiguration<User>
    {

        public UserConfig()
        {
            HasKey(x => x.UserId);

            HasOptional(x => x.AspNetUser).WithMany(x => x.Users).HasForeignKey(x => x.IdentityId);


            ToTable("User");
        }
    }

    public class UserAddressConfig : EntityTypeConfiguration<UserAddress>
    {

        public UserAddressConfig()
        {
            HasKey(x => x.UserAddressId);

            HasOptional(x => x.User).WithMany(x => x.UserAddresses).HasForeignKey(x => x.UserId);


            ToTable("UserAddress");
        }
    }
}
